/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.admanager.soadmanagement.plugin.soadmanagement.impl;

import java.util.Collection;

import org.admanager.soadmanagement.plugin.soadmanagement.PComponentReference;
import org.admanager.soadmanagement.plugin.soadmanagement.PReference;
import org.admanager.soadmanagement.plugin.soadmanagement.soadmanagementPackage;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>PReference</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.admanager.soadmanagement.plugin.soadmanagement.impl.PReferenceImpl#getPromote <em>Promote</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PReferenceImpl extends PElementImpl implements PReference {
	/**
	 * The cached value of the '{@link #getPromote() <em>Promote</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPromote()
	 * @generated
	 * @ordered
	 */
	protected EList promote;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PReferenceImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return soadmanagementPackage.Literals.PREFERENCE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getPromote() {
		if (promote == null) {
			promote = new EObjectResolvingEList(PComponentReference.class, this, soadmanagementPackage.PREFERENCE__PROMOTE);
		}
		return promote;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case soadmanagementPackage.PREFERENCE__PROMOTE:
				return getPromote();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case soadmanagementPackage.PREFERENCE__PROMOTE:
				getPromote().clear();
				getPromote().addAll((Collection)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case soadmanagementPackage.PREFERENCE__PROMOTE:
				getPromote().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case soadmanagementPackage.PREFERENCE__PROMOTE:
				return promote != null && !promote.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //PReferenceImpl
